import { createStore } from 'vuex'

// 引入vuex持久化方法createPersistedState
import createPersistedstate from 'vuex-persistedstate'
import user from './modules/user'
import cart from './modules/cart'
import category from './modules/category'

export default createStore({
    state: {},
    getters: {},
    mutations: {},
    actions: {},
    modules: {
        user,
        cart,
        category
    },
    plugins: [
        // veux持久化配置
        createPersistedstate({
            key: 'erabbit-client-pc-store',
            paths: ['user', 'cart']
        })
    ]

})